<template>
  <div class="card-demo">
    <div class="card-name">
      <span class="title-name">{{ cardData.headerName }}</span>
      <span class="card-demo-status">{{ cardData.flag }}</span>
    </div>
    <div class="card-main">{{ cardData.headerValue }}</div>
    <div class="card-foot">
      <span class="title-name">{{ cardData.footerName }}</span>
      <span class="card-foot-status">{{
        cardData.footerValue + cardData.footerUnit
      }}</span>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    cardData: {
      require: true,
    },
  },
  mounted() {
    // console.log("th", this.$props.cardData);
  },
};
</script>

<style lang="scss" scoped>
.card-demo {
  width: 100%;
  height: 100%;
  background-color: #ffffff;
  border-radius: 5px;
  overflow: hidden;
  padding: 10px;
  .card-name {
    width: 100%;
    height: 30px;
    line-height: 30px;
    display: flex;
    padding: 0 10px;
    justify-content: space-between;
    .title-name {
      width: auto;
      font-size: 14px;
      padding: 0 10px;
      overflow: hidden;
    }
    .card-demo-status {
      background-color: #f0f9eb;
      padding: 0 10px;
      font-size: 12px;
      color: #15d04d;
      border-radius: 5px;
      overflow: hidden;
    }
  }
  .card-foot {
    width: 100%;
    height: 30px;
    line-height: 30px;
    display: flex;
    padding: 0 10px;
    justify-content: space-between;
    .title-name {
      width: auto;
      font-size: 12px;
      padding: 0 10px;
    }
    .card-foot-status {
      padding: 0 10px;
      font-size: 12px;
      border-radius: 5px;
      overflow: hidden;
    }
  }
  .card-main {
    width: 100%;
    height: 70px;
    font-size: 34px;
    line-height: 70px;
    padding-left: 15px;
    font-weight: bold;
    overflow: hidden;
  }
}
</style>
